<div id="tiga_ba">
	<div id="tiga_baa">Data Tarif Laboratorium </div>
	<?php
	if(!empty($_GET['nama'])){
		$param_nama=$_GET['nama'];
	}else{
		$param_nama=$_POST['nama'];
	}
	$id_ppk=$_GET['id_ppk'];
?>
	<div id="tiga_bab">
		<a href="javascript:void(0)" onClick="location.href='utama.php?module=mod_tarif_laboratorium&id_ppk=<?php echo $id_ppk;?>&view=form_tambah'">
			<button class="button">Tambah</button>
		</a>
	</div>
	<div class="clear"></div>
</div>



<table style="margin-left: 5px;" width="830">
	<tr>
		<form method=post action='utama.php?module=mod_tarif_laboratorium&id_ppk=<?php echo $id_ppk;?>'>
		<td width="65">Pencarian  : </td>
		<td width="200"><input type="text" name="nama" value="<?php echo $param_nama; ?>" class="input_field" /></td>
		<td></td>
		<td><input name="submit" type="submit" class="button" value="Cari" /></td>
		<td></td>
		</form>
		<form method="post" enctype="multipart/form-data" action="module/mod_tarif_laboratorium/proses.php">
		<td>Import CSV :</td>
		<td><input name="userfile" type="file"><input type="hidden" name="ppk" value="<?php echo $id_ppk; ?>"></td>
		<td><input name="upload" type="submit" class="button" value="Import"></td>
		</form>
		<td>
			<a href="module/mod_tarif_laboratorium/cetak_master.php?id=<?php echo $id_ppk;?>">
				<img src="asset/images/master.png" width="30">
			</a>
		</td>
		<td align="right">
			<a href="module/mod_tarif_laboratorium/cetak.php?id=<?php echo $id_ppk;?>">
				<img src="asset/images/print.png" width="30">
			</a>
		</td>
	</tr>
</table>

<table class="tabel">
	<tr>
		<th>NO</th>
		<th>Aksi</th>
		<th>Nama Laboratorium</th>
		<th>Tarif</th>
	</tr>
	<?php
		$p= new paging ;
		$batas= 10;

		//cek halaman dan posisi halaman
		$posisi = $p ->cariposisi($batas) ;
		$sql="SELECT b.id_tarif,a.id_lab as id,a.nama_lab ,b.tarif FROM master_lab a LEFT JOIN tarif_laboratorium b ON a.id_lab=b.id_lab where nama_lab like '%$param_nama%' and id_ppk='$id_ppk' order by nama_lab asc limit $posisi,$batas";
		$qry=mysql_query($sql);
		$no=$posisi + 1;
		if(mysql_num_rows($qry)>0){
		
			while($hasil=mysql_fetch_array($qry)){
	?>
				<tr>
					<td align="center" width="30"><?php echo $no;?></td>
					<td align="center" align="center" width="60">
						<a href="utama.php?module=mod_tarif_laboratorium&id_ppk=<?php echo $_GET['id_ppk'];?>&view=form_edit&id=<?php echo $hasil['id_tarif'];?>">
						<img src="asset/images/edit.png" title="Ubah Data"></a> 
						<a href="utama.php?module=mod_tarif_laboratorium&id_ppk=<?php echo $_GET['id_ppk'];?>&act=hapus&id=<?php echo $hasil['id_tarif'];?>" onclick="return confirm('Anda yakin ingin Menghapus Data ?')"><img src="asset/images/delete.png" title="Hapus Data"></a>
					</td>
					<td ><?php echo $hasil['nama_lab'];?></td>
					<td align="right" width="60"><?php echo desimal($hasil['tarif']);?></td>
				</tr>
				
		<?php
				$no++;
			}
		}else{
		?>
	
	<tr>
		<td colspan="7" align="center">Data tidak Ada </td>
	</tr>
	
	<?php
		}
	?>
</table>

<?php
	$sql2="SELECT b.id_tarif,a.id_lab as id,a.nama_lab ,b.tarif FROM master_lab a LEFT JOIN tarif_laboratorium b ON a.id_lab=b.id_lab where nama_lab like '%$param_nama%' and id_ppk='$id_ppk'" ;
	$query2=mysql_query($sql2);
	$jumlah_data=mysql_num_rows($query2);
	//dapatkan jumlah halaman
	$jumlah_halaman= $p->jumlahhalaman($jumlah_data,$batas);
	//cetak link
	$linkhalaman=$p->navhalaman($_GET['halaman'],$jumlah_halaman,$_SERVER['PHP_SELF']."?module=mod_tarif_laboratorium&id_ppk=$id_ppk","nama=$param_nama");
	print($linkhalaman);
?>
 <div id="tiga_bab">
		
		<a href="javascript:void(0)" onClick="location.href='utama.php?module=mod_tarif_laboratorium&id_ppk=<?php echo $id_ppk;?>&view=form_edit_semua&halaman=<?php echo $_GET['halaman'];?>&nama=<?php echo $param_nama;?>'">
			<button class="button">Edit</button>
		</a>
	</div>
        